#pragma once
#include <windows.h>
#include <string.h>
#include <map>
#include <iostream>
#include <sstream>
#include <fstream>

using namespace std;

class Config
{
private:
	//static Config *instance;
	map<string, string> conf;
	int dydis;
	wstring getConfigPath(wstring path);

public:
	Config(void);
	~Config(void);
	void loadConfig(wstring fileName);
	void saveConfig(wstring fileName);

	float stringToFloat(string value);
	int stringToInt(string value);
	string IntToString(int value);
	string floatToString(float value);

	int getInt(string name);
	float getFloat(string name);
	string getString(string name);

	void setInt(string name, int value);
	void setFloat(string name, float value);
	void setString(string name, string  value);

	void print();
	
	void setSoundLevel(float level);
	float getSoundLevel();


	string choppa(const string &t, const string &ws)
	{
		string str = t;
		size_t found;
		found = str.find_last_not_of(ws);
		if (found != string::npos)
    		str.erase(found+1);
		else
    		str.clear();            // str is all whitespace

		return str;
	}

	/*
	void setLastSong(int id);
	int getLastSong();
	void setPlaylist(string path);
	string getPlaylist();
	void setLastSongProgress(float progress);
	float getLastSongProgress();
	void setShuffle(bool state);
	bool getShuffle();
	void setPause(bool state);
	bool getPause();
	*/
};

